<template>
  <div id="app">
    <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
      <el-menu-item index="Home">首页</el-menu-item>
      <el-submenu index="2">
        <template slot="title">小功能</template>
        <el-menu-item index="TreeFilter">节点过滤</el-menu-item>
        <el-menu-item index="Table">表格相关</el-menu-item>
      </el-submenu>
    </el-menu>
    <div class="content">
      <router-view/>
    </div>
  </div>
</template>

<style>
html,body{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
*{
  box-sizing: border-box;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}
</style>

<script>
export default {
  name: 'Home',
  data() {
    return {
      activeIndex: 'Home'
    };
  },
  created () {
    this.$router.push("/");
  },
  methods: {
    handleSelect(key, keyPath) {
      this.$router.replace({ name: key })
    }
  }
}
</script>
